package com.openatc.model.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author ：zhangwenchao
 * @date ：Created in 2021/10/25 0:07
 * @description：control/pattern
 * @modified By：
 * @version: $
 */
@Data
public class ControlPatternLockPhase {
    int greenflash;
    int duration;
    int yellow;
    int redclear;
    int mingreen;
    List<PhaseType> phases;

    public ControlPatternLockPhase(Set<Integer> lockphases, int dur){
        greenflash = 3;
        yellow = 3;
        redclear = 2;
        mingreen = 3;
        duration = dur;
        phases = new ArrayList<>();

        for(Integer phaseid : lockphases){
            phases.add(new PhaseType(phaseid));
        }

    }

    class PhaseType{
        int id;
        int type;

        public PhaseType(int phaseid){
            id = phaseid;
            type = 1;
        }

    }
}
